package com.xt.partjobback.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author leotong
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseEntity {

    @TableId(type = IdType.AUTO)
    public Integer id;

    @TableField("createTime")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    public Date createTime;

    @TableField("isDelete")
    @TableLogic(value = "false",delval = "true")
    public Boolean isDelete;

    @TableField(exist = false)
    public Integer pageNum;
    @TableField(exist = false)
    public Integer pageSize;
    @TableField(exist = false)
    public String token;
}
